GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test#102538
Merged
miss-islington merged 2 commits intopython:mainfrom Mar 10, 2023
Merged
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test#102538miss-islington merged 2 commits intopython:mainfrom
miss-islington merged 2 commits intopython:mainfrom
Conversation
It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action. Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
Member
Author
|
@hugovk Do you mind taking a look at the strategy here? There's an equivalent PR for I figure it's likely to get more attention over here, so we can do the review here and incorporate any changes made here over there if necessary. |
Contributor
|
Thanks @pganssle for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
|
GH-102586 is a backport of this pull request to the 3.11 branch. |
|
GH-102587 is a backport of this pull request to the 3.10 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Mar 10, 2023
…st (pythonGH-102538) It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action. Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway. (cherry picked from commit 64bde50) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Mar 10, 2023
…st (pythonGH-102538) It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action. Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway. (cherry picked from commit 64bde50) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
miss-islington
added a commit
that referenced
this pull request
Mar 10, 2023
…-102538) It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action. Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway. (cherry picked from commit 64bde50) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
miss-islington
added a commit
that referenced
this pull request
Mar 13, 2023
…-102538) It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action. Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway. (cherry picked from commit 64bde50) Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is possible but unlikely for the
python_tzpath_contextfunction to fail between the start of thetryblock and the point whereos.environ.getsucceeds, in which caseold_envwill be undefined. In this case, we want to take no action.Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
Automerge-Triggered-By: GH:pganssle